package StudyCode.summary.mycollection;

import java.util.Collection;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class To2DArrayByStreamCollectors {

	public static double[][] to2DArray(Collection<double[]> collection) {
		return collection.toArray(new double[collection.size()][]);
	}

	public static double[][] to2DArray(Stream<double[]> stream) {
		return to2DArray(stream.collect(Collectors.toList()));
	}
}
